<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorate="content">
<head>
<head>
<meta charset="utf-8">
<title>OMS进口管理系统—部门</title>
</head>
<body>
	<div layout:fragment="content">
		<table style="width: 100%;" data-bind="with:filter">
			<tbody>
				<tr>
					<td class="td_form01">上级部门:</td>
					<td class="td_form02"><input type="text"
						data-bind="value:parentName"></td>
					<td class="td_form01">部门名称:</td>
					<td class="td_form02"><input type="text"
						data-bind="value:departmentName" /></td>
					<td class="td_form01">部门等级</td>
					<td class="td_form02"><select data-bind="value:level">
							<option value="">请选择</option>
							<option value="1">业务级部门</option>
							<option value="2">行政级部门</option>
							<option value="3">技术级部门</option>
					</select></td>
				</tr>
				<tr>
					<td colspan="3" class="td_form01 text-center"><input
						type="button" class="buttonface" value="请空"
						data-bind="click:$root.empty" /></td>
					<td colspan="3" class="td_form01 text-center"><input
						type="button" class="buttonface" value="查询"
						data-bind="click:$root.search" /></td>
				</tr>
			</tbody>
		</table>
		<div class="Organization_cot">
			<p class="top_bg clearfix">
				<i class="icon popAdd"> <img src="/images/add.png" alt="">
				</i> <a class="Add" data-bind="click:$root.addDepartment">添加</a>
			</p>
		</div>
		<div class="list_page">
			<table>
				<thead>
					<tr>
						<td class="td_top" style="text-align: center;">序号</td>
						<td class="td_top" style="text-align: center;">部门名称</td>
						<td class="td_top" style="text-align: center;">上级部门</td>
						<td class="td_top" style="text-align: center;">部门级别</td>
						<td class="td_top" style="text-align: center;">部门备注</td>
						<td class="td_top" style="text-align: center;">操作</td>
					</tr>
				</thead>
				<tbody id="tbody" data-bind="foreach:DataGrid.DataRows">
					<tr>
						<td data-bind="text:$index()+1" style="text-align: center;">7</td>
						<td class="departmentName" data-bind="text:departmentName"
							style="text-align: center;">操作部</td>
						<td data-bind="text:parentName" style="text-align: center;">河南集成供应链有限公司</td>
						<td data-bind="text:level" style="text-align: center;">1</td>
						<td data-bind="text:note" style="text-align: center;">测试</td>
						<td style="text-align: center;">
							<button type="button" class="pure-button pure-button-primary"
								data-bind="click:$root.updateDepartment">修改</button>
							<button type="button" class="pure-button button-warning"
								data-bind="click:$root.deleteDepartment">删除</button>
						</td>
					</tr>
				</tbody>
			</table>
		</div>

		<!--弹出框  -->
		<div id="pop_div_department" style="display: none; padding: 5px;">
			<table data-bind="with:model" class="table table-hover"
				Style="height: 100%; width: 100%;">
				<tr>
					<td class="td_form01"><label> <span class="tip"
							style="color: red;">*</span>上级部门：
					</label></td>
					<td class="td_form02"><input type="text" id="text_parentName"
						data-bind="value:parentName"> <span class="downArrow"
						data-bind="event:{click:$root.depclick}"> <i
							class="icon iconfont icon-sanjiao-bottom"></i>
					</span>
						<div id="treeDiv" style="display: none">
							<ul id="treeDemo" class="ztree"></ul>
						</div> <span id="parentNameMessage" style="display: none;">部门名称不能为空</span>
					</td>
				</tr>
				<tr>
					<td class="td_form01"><label><span class="tip"
							style="color: red;">*</span>部门名称：</label></td>
					<td class="td_form02"><input type="text"
						data-bind="value:departmentName"><span id="nameMessage"
						style="display: none;">部门名称不能为空</span></td>
				</tr>

				<tr>
					<td class="td_form01"><label>部门级别：</label></td>
					<td class="td_form02"><select data-bind="value:level">
							<option value="">请选择</option>
							<option value="1">业务级部门</option>
							<option value="2">行政级部门</option>
							<option value="3">技术级部门</option>
					</select></td>
				</tr>
				<tr>
					<td class="td_form01"><label>是否有下级：</label></td>
					<td class="td_form02"><select data-bind="value:isEnd">
							<option value="0">是</option>
							<option value="1">否</option>
					</select></td>
				</tr>
				<tr>
					<td class="td_form01"><label>描述：</label><span class="tip"></span></td>
					<td class="td_form02"><input type="text"
						data-bind="value:note"></td>
				</tr>
				<tr>
					<td class="td_form02 text-center" colspan="2">
						<button type="button" class="saveBtn"
							data-bind="click:$root.submit">
							<i class="iconSave"></i>保存
						</button>
						<button type="button" class="popClose"
							data-bind="click:$root.layerClose">
							<i class="popIcon"></i>关闭
						</button>
					</td>
				</tr>
			</table>
		</div>
		<div th:include="pager :: pager"></div>
	</div>
</body>

</html>

